<template>
  <el-table :data="list" border stripe>
    <el-table-column label="ID" type='index' v-if="index"></el-table-column>
    <el-table-column label="图片">
      <slot name="img"></slot>
    </el-table-column>

    <el-table-column v-for="(item, index) in domList" :prop="item.prop" :key="index" :label="item.label">
    </el-table-column>
    <el-table-column label="类型">
      <slot name="tag"></slot>
    </el-table-column>
    <el-table-column label="状态">
      <slot name="checked"></slot>
    </el-table-column>
    <el-table-column label="time">
      <slot name="time">
        <!-- {{ timeor }} -->
      </slot>
    </el-table-column>
    <el-table-column label="操作">
      <template #default>
        <el-button type='text'>编辑</el-button>
        <el-popconfirm title="确定要删除吗">
          <template #reference>
            <el-button type='text'>删除</el-button>
          </template>
        </el-popconfirm>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { computed, reactive, ref } from 'vue';
import { formatDate } from '@/utils/index.js'

const props = defineProps({
  list: Array,
  domList: Array,
  index: {
    type: String,
    default: ''
  }
})
// const timeor = props.list.map(item => {
//   item.time = formatDate(item.time)
//   return item.time
// })
// // const res =
// console.log(timeor)
// const list = ref([])
// const domList = reactive([])
</script>

<style  scoped></style>